<!ELEMENT document (title, (annotation | chapter | TODO)*)>
<!ATTLIST document
    xml:lang CDATA #REQUIRED
    version CDATA #IMPLIED
    status  (Release | Draft) #IMPLIED>

<!ENTITY % section-content "p | list | code-block | tty | note | precondition | postcondition | invariant | synopsis | TODO">
<!ENTITY % text-with-markup "#PCDATA | tt | u | b | nt | link | xref | badge">

<!ELEMENT chapter (title, (chapter | section | %section-content;)*)>
<!ATTLIST chapter
    xml:id ID #REQUIRED>

<!ELEMENT section (title, (%section-content;)*)>

<!ELEMENT title (%text-with-markup;)*>

<!ELEMENT tty        (#PCDATA | nt)*>
<!ELEMENT code-block (#PCDATA | nt)*>
<!ATTLIST code-block
    lang CDATA #IMPLIED>

<!ELEMENT p (%text-with-markup;)*>

<!ELEMENT synopsis (prototype+, (p | precondition | postcondition | invariant | note | list)*)>

<!ELEMENT prototype (#PCDATA | nt | badge)*>

<!ELEMENT tt (#PCDATA | nt)*>

<!ELEMENT u (#PCDATA | b | nt)*>

<!ELEMENT b (#PCDATA | u | nt)*>

<!ELEMENT nt (#PCDATA)>

<!ELEMENT link (#PCDATA)>
<!ATTLIST link
    href CDATA #IMPLIED>

<!ELEMENT xref EMPTY>
<!ATTLIST xref
    to IDREF #REQUIRED>

<!ELEMENT list (item+)>
<!ATTLIST list
    style (numbered | bulleted | nomarks) #REQUIRED>

<!ELEMENT item (%text-with-markup; | %section-content;)*>

<!ELEMENT note (%text-with-markup; | %section-content;)*>
<!ELEMENT precondition (%text-with-markup; | %section-content;)*>
<!ELEMENT postcondition (%text-with-markup; | %section-content;)*>
<!ELEMENT invariant (%text-with-markup; | %section-content;)*>

<!ELEMENT annotation (documentation*)>
<!ELEMENT documentation (#PCDATA)> <!-- ANY ? -->

<!ELEMENT badge (#PCDATA)>

<!ELEMENT TODO (#PCDATA)>
